﻿$(document).on("pageInit", "#cource-score-list4teacher", function (e, id, page) {
    loadList();

    function loadList() {
        $(page).find("#list").empty();
        $.getJSON("/courcescore/GetScoreList4Teacher", {}, function (response) {
            $.each(response, function (index, item) {
                var frame = $('<li>\
                    <div class="item-content">\
                        <div class="item-inner">\
                            <div class="item-title-row">\
                                <div class="item-title">学生：' + item.StuRealName + '</div>\
                                <div class="item-after">得分：' + item.Score + '</div>\
                            </div>\
                            <div class="item-subtitle">班级：' + (item.ClazzName || '') + '</div>\
                            <div class="item-subtitle">课程：' + (item.CourceName || '') + '</div>\
                            <div class="item-subtitle">评分人：' + (item.CreateRealName || '') + '</div>\
                            <div class="item-subtitle">创建时间：' + item.CreateTime + '</div>\
                        </div>\
                    </div>\
                </li>');
                $(page).find("#list").append(frame);
            });
        });
    }

    $(page).find("#menu-btn").on("click", function () {
        var buttons1 = [
 {
     text: '请选择',
     label: true
 },
 {
     text: '评定学生成绩',
     onClick: function () {
         $.router.load('/courcescore/create', true);
     }
 }];

        var buttons2 = [
          {
              text: '取消',
              bg: 'danger'
          }
        ];
        var groups = [buttons1, buttons2];
        $.actions(groups);
    });
});